Skip to content

Commit

Permalink
Second stage of optimizer_trace optimizations
Browse files Browse the repository at this point in the history
- Move testing of my_writer to inline functions to avoid calls
- Made more functions inline. Especially thd->thread_started()
  is now very optimized!
- Moved Opt_trace_stmt classe to opt_trace_context.h to get critical
  functions inline
  • Loading branch information
montywi committed Mar 9, 2020
1 parent 940fcbe commit a24d092
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 166 deletions.
44 changes: 0 additions & 44 deletions sql/my_json_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -260,50 +260,6 @@ void Json_writer::add_str(const String &str)
add_str(str.ptr(), str.length());
}

Json_writer_object::Json_writer_object(THD *thd) :
Json_writer_struct(thd)
{
if (unlikely(my_writer))
my_writer->start_object();
}

Json_writer_object::Json_writer_object(THD* thd, const char *str) :
Json_writer_struct(thd)
{
if (unlikely(my_writer))
my_writer->add_member(str).start_object();
}

Json_writer_object::~Json_writer_object()
{
if (my_writer && !closed)
my_writer->end_object();
closed= TRUE;
}

Json_writer_array::Json_writer_array(THD *thd) :
Json_writer_struct(thd)
{
if (unlikely(my_writer))
my_writer->start_array();
}

Json_writer_array::Json_writer_array(THD *thd, const char *str) :
Json_writer_struct(thd)
{
if (unlikely(my_writer))
my_writer->add_member(str).start_array();

}
Json_writer_array::~Json_writer_array()
{
if (unlikely(my_writer && !closed))
{
my_writer->end_array();
closed= TRUE;
}
}

Json_writer_temp_disable::Json_writer_temp_disable(THD *thd_arg)
{
thd= thd_arg;
Expand Down
Loading

0 comments on commit a24d092

Please sign in to comment.