Skip to content

Commit

Permalink
Cache the .WHICH of a statement handle
Browse files Browse the repository at this point in the history
If we are re-using the handle to do many executes, then this can shave
around 8% off.
  • Loading branch information
jnthn committed Jan 8, 2019
1 parent d1ed36b commit 97247e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/DBDish/StatementHandle.pm6
Expand Up @@ -22,6 +22,7 @@ has Bool $.Finished = True;
has Int $!affected_rows;
has @!column-name;
has @!column-type;
has $!which = self.WHICH;

# My defined interface
method execute(*@ --> Int) { ... }
Expand All @@ -30,7 +31,7 @@ method _row(--> Array) { ... }
method _free() { ... }

method !ftr() {
$.parent.last-sth-id = self.WHICH;
$.parent.last-sth-id = $!which;
}

method !enter-execute(int $got = 0, int $expect = 0) {
Expand Down

0 comments on commit 97247e2

Please sign in to comment.